import { MAP} from '../../constants'
Page({
  data: {
    active: 0,
    page:1,
    pageSize:5,
    status:1,
    id:'',
    // id:'', // 司机作业单id
    // driverId:'', // 司机id
    // startAgencyId:'',  //起始机构id
    // startAddress:'', // 起始位置
    // endAddress:'', // 结束位置
    // created:'' ,// 时间
    list:[],
    map: MAP
  },
  btn1(e){
    //  console.log(e);
    // let data = 'hello world'; // 准备需要传递给父组件的数据
   const data = wx.navigateTo({
      url: '/index_pkg/pages/route/index',
    })
    this.triggerEvent('myevent', data); 
   },
  btn(){
    //  console.log(this.data.id);
    // let data = 'hello world'; // 准备需要传递给父组件的数据
   const data = wx.navigateTo({
      url: '/index_pkg/pages/delivery/index?id='+ this.data.id,
    })
    this.triggerEvent('myevent', data); 
   },
   onLoad(){
    this.getInfo()
  },
  async getInfo(){
    const res = await wx.$http.get('/driver/tasks/list',{page:this.data.page,pageSize:this.data.pageSize,status:this.data.status})
    const list =res.items
    console.log(list);
    // this.setData({
    //   status:list[0].status,
    //   id:list[0].id,
    //   list
    // })
    },
  onBtn(e){
   console.log(e);
  },
  skip(e){
    console.log(e);
    wx.navigateTo({
      url: '/index_pkg/pages/delivery/index',
    })
  },
  onChange(event) {
    console.log(event.detail.name);
  },
  onBtn(){
    console.log(111);
  }
});
